package com.sex.spring.dao.impl;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.sex.spring.dao.UserDao;
import com.sex.spring.model.User;

@Repository
public class UserDaoImpl  implements UserDao {

	@Autowired
	private SessionFactory sf;
	
	public Session getSession(){
		System.err.println("开启session！！");
		return sf.getCurrentSession();
	}
	@Override
	public void addUser(User record) {
		getSession().save(record);
	}

}
